/**
 * Copyright &copy; 2015-2020 <a href="www.dsesa.cn/">ESA</a> All rights reserved.
 */
package com.jeeplus.modules.sys.service;

import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.sys.entity.StockRule;
import com.jeeplus.modules.sys.mapper.StockRuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 数据字典Service
 * @author lgf
 * @version 2017-01-16
 */
@Service
@Transactional(readOnly = true)
public class StockRuleService extends CrudService<StockRuleMapper, StockRule> {

	@Autowired
	private StockRuleMapper stockRuleMapper;

    /**
     * 根据objectId获取档案对应的款项
     * @param object
     * @return
     */
	@Transactional(readOnly = false)
    public List<StockRule> getStockRuleList(String object){
		StockRule stockRule = new StockRule();
		stockRule.setObject(object);
	    return stockRuleMapper.findList1(stockRule);
    }

	@Transactional(readOnly = false)
	public void deleteDictValue(String id) {
		super.delete(new StockRule(id));
	}

}
